<template>
  <div>
    <h1 ref="title">欢迎学习Vue</h1>
    <button ref="btn" @click="showDOM">点我输出上方的DOM元素</button>
    <MySchool ref="Mysch"/>
  </div>
</template>
<script>
// 引入School组件
 import MySchool from './components/School.vue'
export default {
name:'App',
components:{MySchool},
methods:{
  showDOM(){
    console.log(this.$refs.title);
    console.log(this.$refs.btn);
    console.log(this.$refs.Mysch);
  }
}
}
</script>

<style>

</style>